dev 코드와 일치
This commit is contained in:
@@ -205,6 +205,7 @@ def extractGeneralList(generalSheet, nationList={}, nationChiefInfo={}):
|
||||
|
||||
if '환경 변수' in wb.sheet_names():
|
||||
config = parseConfig(wb.sheet_by_name('환경 변수'))
|
||||
config['startYear'] -= 3
|
||||
else:
|
||||
config = {
|
||||
'title':'타이틀'
|
||||
|
||||
+7
-3
@@ -5,9 +5,11 @@ import time
|
||||
import glob
|
||||
import urllib.request
|
||||
import concurrent.futures
|
||||
from datetime import datetime
|
||||
|
||||
def run(webPath):
|
||||
print(webPath)
|
||||
now = datetime.now()
|
||||
print(now.strftime("%Y-%m-%d %H:%M:%S"), webPath)
|
||||
obj = urllib.request.urlopen(webPath)
|
||||
obj.read()
|
||||
|
||||
@@ -44,15 +46,17 @@ def main():
|
||||
|
||||
servList.append(webPath)
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=len(servList)) as executor:
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=max(1,len(servList))) as executor:
|
||||
waiters=[]
|
||||
for resetPath in autoResetList:
|
||||
future = executor.submit(run, resetPath)
|
||||
waiters.append(future)
|
||||
for _ in range(4):
|
||||
for idx in range(4):
|
||||
for webPath in servList:
|
||||
future = executor.submit(run, webPath)
|
||||
waiters.append(future)
|
||||
if idx == 3:
|
||||
break
|
||||
time.sleep(15)
|
||||
for future in waiters:
|
||||
future.done()
|
||||
|
||||
@@ -10,7 +10,7 @@ class KVStorage{
|
||||
static private $storageList = [];
|
||||
|
||||
static public function getStorage(\MeekroDB $db, string $storNamespace, string $tableName='storage'):self{
|
||||
$obj_id = spl_object_id($db);
|
||||
$obj_id = spl_object_hash($db);
|
||||
$fullKey = $obj_id.','.$storNamespace.','.$tableName;
|
||||
if(key_exists($fullKey, static::$storageList)){
|
||||
return static::$storageList[$fullKey];
|
||||
|
||||
+12
-4
@@ -312,9 +312,13 @@ class Session
|
||||
* 로그인 유저의 전역 grade를 받아옴
|
||||
* @return int|null
|
||||
*/
|
||||
public static function getUserGrade($actionOnError = '..')
|
||||
public static function getUserGrade(bool $requireLogin = false, string $exitPath = '..')
|
||||
{
|
||||
$obj = self::requireLogin($actionOnError);
|
||||
if ($requireLogin) {
|
||||
$obj = self::requireLogin($exitPath);
|
||||
} else {
|
||||
$obj = self::getInstance();
|
||||
}
|
||||
|
||||
return $obj->userGrade;
|
||||
}
|
||||
@@ -324,9 +328,13 @@ class Session
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public static function getUserID($actionOnError = '..')
|
||||
public static function getUserID(bool $requireLogin = false, string $exitPath = '..')
|
||||
{
|
||||
$obj = self::requireLogin($actionOnError);
|
||||
if ($requireLogin) {
|
||||
$obj = self::requireLogin($exitPath);
|
||||
} else {
|
||||
$obj = self::getInstance();
|
||||
}
|
||||
|
||||
return $obj->userID;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,79 @@ namespace sammo;
|
||||
|
||||
class TimeUtil
|
||||
{
|
||||
|
||||
/** @deprecated */
|
||||
public static function DateToday()
|
||||
{
|
||||
return date('Y-m-d');
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeNow()
|
||||
{
|
||||
return date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeFromNowDay($day)
|
||||
{
|
||||
return date('Y-m-d H:i:s', strtotime("{$day} days"));
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeFromNowHour($hour)
|
||||
{
|
||||
return date('Y-m-d H:i:s', strtotime("{$hour} hours"));
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeFromNowMinute($minute)
|
||||
{
|
||||
return date('Y-m-d H:i:s', strtotime("{$minute} minutes"));
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeFromNowSecond($second)
|
||||
{
|
||||
return date('Y-m-d H:i:s', strtotime("{$second} seconds"));
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeFromMinute($date, $minute)
|
||||
{
|
||||
return date('Y-m-d H:i:s', strtotime($date) + $minute*60);
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function DatetimeFromSecond($date, $second)
|
||||
{
|
||||
return date('Y-m-d H:i:s', strtotime($date) + $second);
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function CutSecond($date)
|
||||
{
|
||||
$date[17] = '0';
|
||||
$date[18] = '0';
|
||||
return $date;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function CutMinute($date)
|
||||
{
|
||||
$date[14] = '0';
|
||||
$date[15] = '0';
|
||||
$date[17] = '0';
|
||||
$date[18] = '0';
|
||||
return $date;
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
public static function HourMinuteSecond($second)
|
||||
{
|
||||
return date('H:i:s', strtotime('00:00:00') + $second);
|
||||
}
|
||||
|
||||
public static function today()
|
||||
{
|
||||
$obj = new \DateTime();
|
||||
|
||||
@@ -156,7 +156,7 @@ class WebUtil
|
||||
$config = \HTMLPurifier_HTML5Config::createDefault();
|
||||
$config->set('Filter.Custom', array (new \HTMLPurifier_Filter_YouTube()));
|
||||
$config->set('HTML.SafeIframe', true);
|
||||
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vime
|
||||
$config->set('URI.SafeIframeRegexp', '%^(https?:)?//(www\.youtube(?:-nocookie)?\.com/embed/|player\.vimeo\.com/video/)%'); //allow YouTube and Vimeo
|
||||
$def = $config->getHTMLDefinition();
|
||||
$def->info_global_attr['data-flip'] = new \HTMLPurifier_AttrDef_Text;
|
||||
$purifier = new \HTMLPurifier($config);
|
||||
|
||||
Reference in New Issue
Block a user